var showCharts;
require(['highcharts'], function () {
	
	showCharts = function(lineId, organId, rcrdTime, beginTime, endTime, addDrvAnalysis, resultArr, drvOrlicPltNoArr){
		var avgArr = [];
		var params = [];
		params.push({
			name : "beginTime",
			value : beginTime
		},{
			name : "endTime",
			value : endTime
		},{
			name : "addDrvAnalysis",
			value : addDrvAnalysis
		},{
			name : "lineId",
			value : lineId
		},{
			name : "organId",
			value : organId
		});
		$.ajaxExt({
			url : "/drvBehaviorAnalysis/searchLineEnergyChart.htm",
			data : params
		}).done(function(result){
			avgArr.push(result[0].spedCnt);
			avgArr.push(result[0].revupCount);
			avgArr.push(result[0].sharpSldnCount);
			avgArr.push(result[0].bhv7count);
			avgArr.push(result[0].bhv5count);
			var series =[];
			series.push({
				name: '线路平均',
				yAxis: 1,
				data: avgArr
			});
			for(var i=0;i < drvOrlicPltNoArr.length; i++){
				series.push({
					name: drvOrlicPltNoArr[i],
					yAxis: 1,
					data: resultArr[i]
				});
			}
			$("#manyDrvBehaviorAnalysisChart").highcharts({
				title: {
					text: ''
				},
				xAxis: {
					categories: ["超速次数","急加速次数","急减速次数","ABS次数","空档滑行次数"],
					labels: {
						align: 'center',
						y: 50
					},
					lineWidth: 1,
					lineColor: '#808080'
				},
				credits: {
					enabled: false
				},
				yAxis: [
			        	 {
				             title: {
				                 text: '次数'
				             }
				         },{
				        	 min:0,
				             title: {
				                 useHTML:true,
				                 text: ''
				             },
				             opposite: true
				         } 
			         ],
				tooltip: {
					shared: true,
					valueDecimals: 0
				},
				series: series
			});
		});
	};
	
});